<include file="public/header" title="提货单详情" body="g4"/>
<include file="public/header_nav" title="提货单详情" href="javascript:history.back(-1)"/>


<!--订单商品列表-s-->
<div class="ord_list p">
    <div class="maleri30">
        <foreach name="user_kucun" item="goods_num" key="goods_id">
            <a href="{:U('Mobile/Goods/goodsInfo',array('id'=>$goods_id))}">
                <div class="shopprice">
                    <div class="img_or fl">
                        <img src="{$goods_id|goods_thum_images=100,100}"/>
                    </div>
                    <div class="fon_or fl">
                        <h2 class="similar-product-text">{$goodslist[$goods_id][goods_name]}</h2>
                        <div><span class="bac">{$goodslist[$goods_id][spec_key_name]}</span></div>
                    </div>
                    <div class="price_or fr">
                        <p><span>￥</span><span>{$goodslist[$goods_id][shop_price]}</span></p>
                        <p>x{$goods_num}</p>
                    </div>
                </div>
            </a>
        </foreach>
    </div>
</div>
<!--订单商品列表-e-->
<div class="qqz">
    <div class="maleri30">
        <a href="tel:{$tpshop_config['shop_info_phone']}">联系客服</a>
    </div>
</div>
<div class="information_dr ma-to-20">
    <div class="maleri30">
        <div class="tit">
            <h2>基本信息</h2>
        </div>
        <div class="xx-list">
            <p class="p">
                <span class="fl">提货单编号</span>
                <span class="fr">{$order_info.tihuo_sn}</span>
            </p>
            <p class="p">
                <span class="fl">下单时间</span>
                <span class="fr"><span>{:date('Y-m-d  H:i:s', $order_info.add_time)}</span></span>
            </p>
            <p class="p">
                <span class="fl">订单状态</span>
                <span class="fr">
                    <if condition="$order_info.order_status eq 1 and $order_info.shipping_status eq 0 ">
                        <span>待审核</span>
                    </if>
                    <if condition="$order_info.order_status eq 2 and $order_info.shipping_status eq 0 ">
                        <span>待发货</span>
                    </if>
                    <if condition="$order_info.order_status eq 3 and $order_info.shipping_status eq 1 ">
                        <span>待收货</span>
                    </if>
                    <if condition="$order_info.order_status eq 4 and $order_info.shipping_status eq 1 ">
                        <span>已完成</span>
                    </if>
                </span>
            </p>
            <p class="p">
                <span class="fl">收货地址</span>
                <span class="fr">{$region_list[$order_info[province]]}&nbsp;{$region_list[$order_info[city]]}&nbsp;{$region_list[$order_info[district]]}&nbsp;{$order_info[address]}</span>
            </p>
            <p class="p">
                <span class="fl">收货人</span>
                <span class="fr"><span>{$order_info.consignee}</span><span>{$order_info.mobile}</span></span>
            </p>
            <p class="p">
                <span class="fl">支付状态</span>
                <span class="fr">已支付,提货</span>
            </p>
            <p class="p">
                <span class="fl">配送方式</span>
                <span class="fr">{$order_info.shipping_name}</span>
            </p>
            <p class="p">
                <span class="fl">买家留言</span>
                <span class="fr">{$order_info.user_note}</span>
            </p>
        </div>
    </div>
</div>
<if condition="$order_info['shipping_status'] eq 1">
<div class="information_dr ma-to-20">
    <div class="maleri30">
        <div class="tit">
            <h2>物流信息</h2>
        </div>
        <div class="xx-list" id="express_info">
            <p class="p">
                <span class="fl">送货方式：</span>
                <span class="fr"><span>{$order_info.shipping_name}</span></span>
            </p>
            <if condition="$order_info['shipping_code'] neq 'ziti' ">
            <p class="p">
                <span class="fl">快递单号：</span>
                <span class="fr"><span>{$order_info.shipping_sn}</span></span>
            </p>
            </if>
        </div>
    </div>
</div>
<script>
queryExpress();
function queryExpress()
{
    var shipping_code = "{$order_info['shipping_code']}";
    var invoice_no = "{$order_info['invoice_no']}";
    $.ajax({
        type : "GET",
        dataType: "json",
        url:"/index.php?m=Home&c=Api&a=queryExpress&shipping_code="+shipping_code+"&invoice_no="+invoice_no,//+tab,
        success: function(data){
            var html = '';
            if(data.status == 200){
                $.each(data.data, function(i,n){
                    if(i == 0){
                        html += "<p class='p'><span class='fl'>"+n.time+"</span><span class='fr'><span>"+n.context+"</span></span></p>";
                    }else{
                        html += "<p class='p'><span class='fl'>"+n.time+"</span><span class='fr'><span>"+n.context+"</span></span></p>";
                    }
                });
            }else{
                html += "<p class='p'><span class='fl'>物流状态：</span><span class='fr'><span>未查到物流信息</span></span></p>";
            }
            $("#express_info").append(html);
        }
    });
}
</script>
</if>

<div class="mask-filter-div" style="display: none;"></div>

<!--底部支付栏-s-->
<if condition="$order_info.order_status eq 3 and $order_info.shipping_status eq 1 ">
    <div class="payit ma-to-20">
        <div class="fr s">
            <a href="javascript:;" onclick="order_confirm({$order_info['id']})">确认收货</a>
        </div>
    </div>
</if>
<!--底部支付栏-d-->
<script src="/template/pc/rainbow/static/js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/public/static/js/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
    //取消订单按钮
    $('.closeorder_butt').click(function(){
        $('.mask-filter-div').show();
        $('.losepay').show();
    })
    //取消取消订单
    $('.qx-rebd .ax').click(function(){
        $('.mask-filter-div').hide();
        $('.losepay').hide();
    })

    //确定收货
    function order_confirm(tihuo_id){
        layer.confirm("你确定收到货了吗?",{
            btn:['确定','取消']
        },function(){
            $.ajax({
                type : 'post',
                url : '/index.php?m=mobile&c=user&a=tihuo_confirm&tihuo_id='+tihuo_id,
                dataType : 'json',
                success : function(data){
                    if(data.status == 1){
                        showErrorMsg(data.msg);
                        window.location.href = data.url;
                    }else{
                        showErrorMsg(data.msg);
                    }
                },
                error : function(XMLHttpRequest, textStatus, errorThrown) {
                    showErrorMsg('网络失败，请刷新页面后重试');
                }
            })
        }, function(index){
            layer.close(index);
        });
    }
</script>
</body>
</html>
